import sys
import spaghetti

def say_something(s):
  print s

#attach say_something as interrupt 10 to use register A as input
spaghetti.attach_interrupt(10,say_something,["A"])

if len(sys.argv) < 2:
  print 'Please enter a filename (example: "bowl.exe test.n")'
else:
  code = open(sys.argv[1],'r').read()
  vm = SpaghettiVM()
  vm.execute(code)